package com.yystudy.system.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yystudy.common.result.Result;
import com.yystudy.model.system.SysLoginLog;
import com.yystudy.model.vo.SysLoginLogQueryVo;
import com.yystudy.system.service.LoginLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "登录日志管理接口")
@RestController
@RequestMapping(value="/admin/system/sysLoginLog")
public class SysLoginLogController {

    @Autowired
    private LoginLogService sysLoginLogService;


    /**
     * 分页条件查询
     * @param page
     * @param limie
     * @param sysLoginLogQueryVo
     * @return
     */
    @ApiOperation(value = "分页条件查询")
    @PreAuthorize("hasAuthority('bnt.sysLoginLog.list')")
    @GetMapping("/{page}/{limie}")
    public Result logIndex(@PathVariable Long page,
                           @PathVariable Long limie,
                           SysLoginLogQueryVo sysLoginLogQueryVo){
        IPage<SysLoginLog> pageModel = sysLoginLogService.selectPage(page,limie,sysLoginLogQueryVo);
        return Result.ok(pageModel);
    }


}
